import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { CoinServiceService } from './coin-service.service';
import { CreateCoinServiceDto } from './dto/create-coin-service.dto';
import { UpdateCoinServiceDto } from './dto/update-coin-service.dto';

@ApiTags('积分服务')
@Controller('coinservice')
export class CoinServiceController {
  constructor(private readonly coinServiceService: CoinServiceService) { }

  @Post()
  async create(@Body() createCoinServiceDto: CreateCoinServiceDto) {
    return await this.coinServiceService.create(createCoinServiceDto);
  }

  @Get()
  async findAll() {
    return await this.coinServiceService.findAll();
  }

  @Get('page')
  async findPage(@Query() query: any) {
    return await this.coinServiceService.findPage(query)
  }

  @Get(':id')
  async findOne(@Param('id') id: string) {
    return await this.coinServiceService.findOne(id);
  }

  @Patch(':id')
  async update(@Param('id') id: string, @Body() updateCoinServiceDto: UpdateCoinServiceDto) {
    return await this.coinServiceService.update(id, updateCoinServiceDto);
  }

  @Delete(':id')
  async remove(@Param('id') id: string) {
    return await this.coinServiceService.remove(id);
  }

  @Post('delMany')
  manyRemove(@Body() body: string[]) {
    return this.coinServiceService.manyRemove(body)
  }
}
